<!--<style>-->
<!--    .layui-card .layui-word-aux {-->
<!--        color: #ff0000 !important;-->
<!--    }-->
<!--</style>-->
{volist name="formList" id="vo"}

{switch name="vo.type"}
{case value="hidden"}
{if $vo.value}<input type="hidden" class="form-control" name="{$vo.name}" value="{$vo.value}">{/if}
{/case}
{case value="readonly"}
<div class="layui-form-item item-{$vo.name} {$vo.extra_class|default=''}">
    <label class="layui-form-label">{$vo.title}</label>
    <div class="layui-input-inline">
        <input readonly type="text" name="{$vo.name}" placeholder="请输入{$vo.title}" autocomplete="off"
        class="layui-input" value="{$vo.value}">
    </div>
</div>
{/case}
{case value="tip"}
<div class="layui-form-item item-tip">
    <label class="layui-form-label">{$vo.title}</label>
    <span style="color: red">{$vo.remark|raw}</span>
</div>
{/case}
{case value="text"}
<div class="layui-form-item item-{$vo.name} {$vo.extra_class|default=''}">
    <label class="layui-form-label">{$vo.title} {if condition="isset($vo.is_require) AND $vo.is_require"}&nbsp;<font
            color="red">*</font>{/if}</label>
    <div class="layui-input-inline">
        <input type="text" name="{$vo.name}" placeholder="请输入{$vo.title}" {if
               condition="isset($vo.is_require) AND $vo.is_require" } lay-verify="required" {/if} autocomplete="off"
        class="layui-input" value="{$vo.value}">
    </div>
    {if $vo.remark}
    <div class="layui-form-mid layui-word-aux">{$vo.remark|raw}</div>
    {/if}
</div>
{/case}
{case value="password"}
<div class="layui-form-item item-{$vo.name} {$vo.extra_class|default=''}">
    <label class="layui-form-label">{$vo.title} {if condition="isset($vo.is_require) AND $vo.is_require"}&nbsp;<font
            color="red">*</font>{/if}</label>
    <div class="layui-input-inline">
        <input type="password" name="{$vo.name}" placeholder="请输入{$vo.title}" {if
               condition="isset($vo.is_require) AND $vo.is_require" } lay-verify="required" {/if} autocomplete="off"
        class="layui-input" value="{$vo.value}">
    </div>
    {if $vo.remark}
    <div class="layui-form-mid layui-word-aux">{$vo.remark|raw}</div>
    {/if}
</div>
{/case}
{case value="number"}
<div class="layui-form-item item-{$vo.name} {$vo.extra_class|default=''}">
    <label class="layui-form-label">{$vo.title} {if condition="isset($vo.is_require) AND $vo.is_require"}&nbsp;<font
            color="red">*</font>{/if}</label>
    <div class="layui-input-inline">
        <input type="number" name="{$vo.name}" {if condition="isset($vo.is_require) AND $vo.is_require" }
               lay-verify="required" {/if} placeholder="请输入{$vo.title}" autocomplete="off" class="layui-input"
        value="{$vo.value}">
    </div>
    {if $vo.remark}
    <div class="layui-form-mid layui-word-aux">{$vo.remark|raw}</div>
    {/if}
</div>
{/case}
{case value="gtnumber"}
<div class="layui-form-item item-{$vo.name} {$vo.extra_class|default=''}">
    <label class="layui-form-label">{$vo.title} {if condition="isset($vo.is_require) AND $vo.is_require"}&nbsp;<font
            color="red">*</font>{/if}</label>
    <div class="layui-input-inline">
        <input min="0" type="number" name="{$vo.name}" {if condition="isset($vo.is_require) AND $vo.is_require" }
               lay-verify="required" {/if} placeholder="请输入{$vo.title}" autocomplete="off" class="layui-input"
        value="{$vo.value}">
    </div>
    {if $vo.remark}
    <div class="layui-form-mid layui-word-aux">{$vo.remark|raw}</div>
    {/if}
</div>
{/case}
{case value="price"}
<div class="layui-form-item item-{$vo.name} {$vo.extra_class|default=''}">
    <label class="layui-form-label">{$vo.title} {if condition="isset($vo.is_require) AND $vo.is_require"}&nbsp;<font
            color="red">*</font>{/if}</label>
    <div class="layui-input-inline">
        <input min="0" step="0.01" type="number" name="{$vo.name}" {if condition="isset($vo.is_require) AND $vo.is_require" }
               lay-verify="required" {/if} placeholder="请输入{$vo.title}" autocomplete="off" class="layui-input"
        value="{$vo.value}">
    </div>
    {if $vo.remark}
    <div class="layui-form-mid layui-word-aux">{$vo.remark|raw}</div>
    {/if}
</div>
{/case}
{case value="switch"}
<div class="layui-form-item item-{$vo.name} {$vo.extra_class|default=''}">
    <label class="layui-form-label">{$vo.title} {if condition="isset($vo.is_require) AND $vo.is_require"}&nbsp;<font
            color="red">*</font>{/if}</label>
    <div class="layui-input-inline">
        <input type="checkbox" name="{$vo.name}" lay-filter="{$vo.name}" lay-skin="switch" lay-text="ON|OFF" value="{$vo['value']}" {if 1==$vo['value']} checked='' {/if}>
    </div>
    {if $vo.remark}
    <div class="layui-form-mid layui-word-aux">{$vo.remark|raw}</div>
    {/if}
</div>
{/case}
{case value="array"}
<div class="layui-form-item item-{$vo.name} {$vo.extra_class|default=''} layui-form-text">
    <label class="layui-form-label">{$vo.title} {if condition="isset($vo.is_require) AND $vo.is_require"}&nbsp;<font
            color="red">*</font>{/if}</label>
    <div class="layui-input-inline">
        <textarea name="{$vo.name}" placeholder="请输入{$vo.title}" class="layui-textarea">{$vo.value}</textarea>
    </div>
    {if $vo.remark}
    <div class="layui-form-mid layui-word-aux">{$vo.remark|raw}</div>
    {/if}
</div>
{/case}
{case value="checkbox"}
<div class="layui-form-item item-{$vo.name} {$vo.extra_class|default=''}" pane="">
    <label class="layui-form-label">{$vo.title} {if condition="isset($vo.is_require) AND $vo.is_require"}&nbsp;<font
            color="red">*</font>{/if}</label>
    {if $vo.checkall}
    <div>
        <input type="checkbox" lay-skin="primary" title="全选" id="checkall" name="type" lay-filter="allChoose"
               value=""/>
    </div>
    {/if}
    <div class="layui-input-inline">
        {volist name="vo.options" id="v"}
        <input lay-filter="{$vo.name}" type="checkbox" name="{$vo.name}[]" lay-skin="primary" title="{$v}" value="{$key}" {if (!empty($vo['value'])
        && in_array($key,$vo['value']))}checked{/if}>
        {/volist}
    </div>
    {if $vo.remark}
    <div class="layui-form-mid layui-word-aux">{$vo.remark|raw}</div>
    {/if}
</div>
{/case}
{case value="radio"}
<div class="layui-form-item item-{$vo.name} {$vo.extra_class|default=''}">
    <label class="layui-form-label">{$vo.title} {if condition="isset($vo.is_require) AND $vo.is_require"}&nbsp;<font
            color="red">*</font>{/if}</label>
    <div class="layui-input-inline">
        {volist name="vo.options" id="v"}
        <input lay-filter="{$vo.name}" type="radio" name="{$vo.name}" value="{$key}" title="{$v}" {if
               $key==$vo['value']}checked='' {/if}>
        {/volist}
    </div>
    {if $vo.remark}
    <div class="layui-form-mid layui-word-aux">{$vo.remark|raw}</div>
    {/if}
</div>
{/case}
{case value="select"}
<div class="layui-form-item item-{$vo.name} {$vo.extra_class|default=''}">
    <label class="layui-form-label">{$vo.title} {if condition="isset($vo.is_require) AND $vo.is_require"}&nbsp;<font
            color="red">*</font>{/if}</label>
    <div class="layui-input-inline">
        <select lay-search name="{$vo.name}" {if condition="isset($vo.is_require) AND $vo.is_require" }
                lay-verify="required" {/if} lay-filter="{$vo.name}" >
        <option value=""></option>
        {volist name="vo.options" id="v"}
        <option value="{$key}" {if $key==$vo['value']} selected="" {/if}>{$v}</option>
        {/volist}
        </select>
    </div>
    {if $vo.remark}
    <div class="layui-form-mid layui-word-aux">{$vo.remark|raw}</div>
    {/if}
</div>
{/case}
{case value="select-checkbox"}
<div class="layui-form-item item-{$vo.name} {$vo.extra_class|default=''}">
    <label class="layui-form-label">{$vo.title} {if condition="isset($vo.is_require) AND $vo.is_require"}&nbsp;<font
            color="red">*</font>{/if}</label>
    <div class="layui-input-inline">
        <div id="demo1"></div>
    </div>

    <!-- 引入插件 -->
    <script src="__STATIC__/libs/xm-select-master/dist/xm-select.js" type="text/javascript" charset="utf-8"></script>
    <!-- 渲染页面 -->
    <script type="text/javascript">
        var demo1 = xmSelect.render({
            // 这里绑定css选择器
            el: '#demo1',
            name: '{$vo.name}',
            toolbar: {
                show: true,
            },
            filterable: true,
            autoRow: true,
            // 渲染的数据
            data: [],
        })

        // 获取选中值, demo1.getValue();
        $.ajax({
            method: 'get',
            url: "{$vo.remark}",
            success: function (response) {
                var res = response.data;
                demo1.update({
                    data: res,
                    autoRow: true,
                })
            }
        });
    </script>

</div>
{/case}
{case value="color"}
<div class="layui-form-item item-{$vo.name} {$vo.extra_class|default=''}">
    <label class="layui-form-label">{$vo.title} {if condition="isset($vo.is_require) AND $vo.is_require"}&nbsp;<font
            color="red">*</font>{/if}</label>
    <div class="layui-input-inline">
        <div class="layui-input-inline" style="width: 120px;">
            <input type="text" name="{$vo.name}" value="{$vo.value}" placeholder="请选择颜色"
                   class="layui-input test-form-input-{$vo.name}">
        </div>
        <div class="layui-inline" style="left: -11px;">
            <div class="layui-color-box-{$vo.name}"></div>
        </div>
    </div>
    {if $vo.remark}
    <div class="layui-form-mid layui-word-aux">{$vo.remark|raw}</div>
    {/if}
</div>
<script type="text/javascript">
    layui.use('colorpicker', function () {
        var colorpicker = layui.colorpicker;
        colorpicker.render({
            elem: '.layui-color-box-{$vo.name}',
            color: '{$vo.value}',
            done: function (color) {
                $('.test-form-input-{$vo.name}').val(color);
            }
        });
    });
</script>
{/case}
{case value="time"}
<style>
    /**只显示时分 */
    input[readonly] {
        cursor: pointer;
    }

    .layui-laydate-list.laydate-time-list > li:nth-child(3) {
        display: none !important;
    }

</style>
<div class="layui-form">
    <div class="layui-form-item item-{$vo.name} {$vo.extra_class|default=''}">
        <label class="layui-form-label">{$vo.title} {if condition="isset($vo.is_require) AND $vo.is_require"}&nbsp;<font
                color="red">*</font>{/if}</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input time-item" name="{$vo.name}" placeholder="请输入{$vo.title}" value="
<?php
    if(isset($vo['value'])) {
        if(is_numeric($vo['value'])) {
            echo time_format($vo['value'], 2);
        } else {
            echo $vo['value'];
        }
    }
?>
">
        </div>
        {if $vo.remark}
        <div class="layui-form-mid layui-word-aux">{$vo.remark|raw}</div>
        {/if}
    </div>
</div>
<script type="text/javascript">
    layui.use(['laydate'], function () {
        var laydate = layui.laydate;
        lay('.time-item').each(function () {
            laydate.render({
                elem: this,
                trigger: 'click',
                type: 'time',
                format: 'HH:mm'
            });
        });

    });
</script>
{/case}
{case value="date"}
<div class="layui-form">
    <div class="layui-form-item item-{$vo.name} {$vo.extra_class|default=''}">
        <label class="layui-form-label">{$vo.title} {if condition="isset($vo.is_require) AND $vo.is_require"}&nbsp;<font
                color="red">*</font>{/if}</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input date-item" name="{$vo.name}" placeholder="请输入{$vo.title}" value="
<?php
    if(isset($vo['value'])) {
        if(is_numeric($vo['value'])) {
            echo time_format($vo['value'], 2);
        } else {
            echo $vo['value'];
        }
    }
?>
">
        </div>
        {if $vo.remark}
        <div class="layui-form-mid layui-word-aux">{$vo.remark|raw}</div>
        {/if}
    </div>
</div>
<script type="text/javascript">
    layui.use(['laydate'], function () {
        var laydate = layui.laydate;
        lay('.date-item').each(function () {
            laydate.render({
                elem: this,
                trigger: 'click',
            });
        });

    });
</script>
{/case}
{case value="date_en"}
<div class="layui-form">
    <div class="layui-form-item item-{$vo.name} {$vo.extra_class|default=''}">
        <label class="layui-form-label">{$vo.title} {if condition="isset($vo.is_require) AND $vo.is_require"}&nbsp;<font
                color="red">*</font>{/if}</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input date-en-item" name="{$vo.name}" placeholder="请输入{$vo.title}"
                   value="
<?php
    if(isset($vo['value'])) {
        if(is_numeric($vo['value'])) {
            echo time_format($vo['value'], 2);
        } else {
            echo $vo['value'];
        }
    }
?>
">
        </div>
        {if $vo.remark}
        <div class="layui-form-mid layui-word-aux">{$vo.remark|raw}</div>
        {/if}
    </div>
</div>
<script type="text/javascript">
    layui.use(['laydate'], function () {
        var laydate = layui.laydate;
        lay('.date-en-item').each(function () {
            laydate.render({
                elem: this,
                trigger: 'click',
                lang: 'en'
            });
        });

    });
</script>
{/case}
{case value="datetime"}
<div class="layui-form">
    <div class="layui-form-item item-{$vo.name} {$vo.extra_class|default=''}">
        <label class="layui-form-label">{$vo.title} {if condition="isset($vo.is_require) AND $vo.is_require"}&nbsp;<font
                color="red">*</font>{/if}</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input datetime-item" name="{$vo.name}" placeholder="请输入{$vo.title}"
                   value="
<?php
    if(isset($vo['value'])) {
        if(is_numeric($vo['value'])) {
            echo time_format($vo['value'], 0);
        } else {
            echo $vo['value'];
        }
    }
?>
">
        </div>
        {if $vo.remark}
        <div class="layui-form-mid layui-word-aux">{$vo.remark|raw}</div>
        {/if}
    </div>
</div>
<script type="text/javascript">
    layui.use(['laydate'], function () {
        var laydate = layui.laydate;
        lay('.datetime-item').each(function () {
            laydate.render({
                elem: this,
                trigger: 'click',
                type: 'datetime'
            });
        });

    });
</script>
{/case}
{case value="datetime_en"}
<div class="layui-form">
    <div class="layui-form-item item-{$vo.name} {$vo.extra_class|default=''}">
        <label class="layui-form-label">{$vo.title} {if condition="isset($vo.is_require) AND $vo.is_require"}&nbsp;<font
                color="red">*</font>{/if}</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input datetime-en-item" name="{$vo.name}" placeholder="请输入{$vo.title}"
                   value="
<?php
    if(isset($vo['value'])) {
        if(is_numeric($vo['value'])) {
            echo time_format($vo['value'], 0);
        } else {
            echo $vo['value'];
        }
    }
?>
">
        </div>
        {if $vo.remark}
        <div class="layui-form-mid layui-word-aux">{$vo.remark|raw}</div>
        {/if}
    </div>
</div>
<script type="text/javascript">
    layui.use(['laydate'], function () {
        var laydate = layui.laydate;
        lay('.datetime-en-item').each(function () {
            laydate.render({
                elem: this,
                trigger: 'click',
                type: 'datetime',
                lang: 'en',
            });
        });

    });
</script>
{/case}
{case value="daterange"}
<div class="layui-form">
    <div class="layui-form-item item-{$vo.name} {$vo.extra_class|default=''}">
        <label class="layui-form-label">{$vo.title} {if condition="isset($vo.is_require) AND $vo.is_require"}&nbsp;<font
                color="red">*</font>{/if}</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input daterange-item" name="{$vo.name}" placeholder="请输入{$vo.title}"
                   value="
<?php
    if(isset($vo['value'])) {
        if(is_numeric($vo['value'])) {
            echo time_format($vo['value'], 2);
        } else {
            echo $vo['value'];
        }
    }
?>
">
        </div>
        {if $vo.remark}
        <div class="layui-form-mid layui-word-aux">{$vo.remark|raw}</div>
        {/if}
    </div>
</div>
<script type="text/javascript">
    layui.use(['laydate'], function () {
        var laydate = layui.laydate;
        lay('.daterange-item').each(function () {
            laydate.render({
                elem: this,
                trigger: 'click',
                range: true,
            });
        });

    });
</script>
{/case}
{case value="daterange_en"}
<div class="layui-form">
    <div class="layui-form-item item-{$vo.name} {$vo.extra_class|default=''}">
        <label class="layui-form-label">{$vo.title} {if condition="isset($vo.is_require) AND $vo.is_require"}&nbsp;<font
                color="red">*</font>{/if}</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input daterange-en-item" name="{$vo.name}" placeholder="请输入{$vo.title}"
                   value="
<?php
    if(isset($vo['value'])) {
        if(is_numeric($vo['value'])) {
            echo time_format($vo['value'], 2);
        } else {
            echo $vo['value'];
        }
    }
?>
">
        </div>
        {if $vo.remark}
        <div class="layui-form-mid layui-word-aux">{$vo.remark|raw}</div>
        {/if}
    </div>
</div>
<script type="text/javascript">
    layui.use(['laydate'], function () {
        var laydate = layui.laydate;
        lay('.daterange-en-item').each(function () {
            laydate.render({
                elem: this,
                trigger: 'click',
                range: true,
                lang: 'en',
            });
        });

    });
</script>
{/case}
{case value="timerange"}
<div class="layui-form">
    <div class="layui-form-item item-{$vo.name} {$vo.extra_class|default=''}">
        <label class="layui-form-label">{$vo.title} {if condition="isset($vo.is_require) AND $vo.is_require"}&nbsp;<font
                color="red">*</font>{/if}</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input timerange-item" name="{$vo.name}" placeholder="请输入{$vo.title}"
                   value="
<?php
    if(isset($vo['value'])) {
        if(is_numeric($vo['value'])) {
            echo time_format($vo['value'], 0);
        } else {
            echo $vo['value'];
        }
    }
?>
">
        </div>
        {if $vo.remark}
        <div class="layui-form-mid layui-word-aux">{$vo.remark|raw}</div>
        {/if}
    </div>
</div>
<script type="text/javascript">
    layui.use(['laydate'], function () {
        var laydate = layui.laydate;
        lay('.timerange-item').each(function () {
            laydate.render({
                elem: this,
                trigger: 'click',
                type: 'datetime',
                range: true,
            });
        });

    });
</script>
{/case}
{case value="timerange_en"}
<div class="layui-form">
    <div class="layui-form-item item-{$vo.name} {$vo.extra_class|default=''}">
        <label class="layui-form-label">{$vo.title} {if condition="isset($vo.is_require) AND $vo.is_require"}&nbsp;<font
                color="red">*</font>{/if}</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input timerange-en-item" name="{$vo.name}" placeholder="请输入{$vo.title}"
                   value="
<?php
    if(isset($vo['value'])) {
        if(is_numeric($vo['value'])) {
            echo time_format($vo['value'], 0);
        } else {
            echo $vo['value'];
        }
    }
?>
">
        </div>
        {if $vo.remark}
        <div class="layui-form-mid layui-word-aux">{$vo.remark|raw}</div>
        {/if}
    </div>
</div>
<script type="text/javascript">
    layui.use(['laydate'], function () {
        var laydate = layui.laydate;
        lay('.timerange-en-item').each(function () {
            laydate.render({
                elem: this,
                trigger: 'click',
                type: 'datetime',
                range: true,
                lang: 'en',
            });
        });

    });
</script>
{/case}
{case value="timebetween"}
<div class="layui-form">
    <div class="layui-form-item item-{$vo.name} {$vo.extra_class|default=''}">
        <label class="layui-form-label">{$vo.title} {if condition="isset($vo.is_require) AND $vo.is_require"}&nbsp;<font
                color="red">*</font>{/if}</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input timebetween-item" name="{$vo.name}" placeholder="请输入{$vo.title}"
                   value="
<?php
    if(isset($vo['value'])) {
        if(is_numeric($vo['value'])) {
            echo time_format($vo['value'], 3);
        } else {
            echo $vo['value'];
        }
    }
?>
">
        </div>
        {if $vo.remark}
        <div class="layui-form-mid layui-word-aux">{$vo.remark|raw}</div>
        {/if}
    </div>
</div>
<script type="text/javascript">
    layui.use(['laydate'], function () {
        var laydate = layui.laydate;
        lay('.timebetween-item').each(function () {
            laydate.render({
                elem: this,
                trigger: 'click',
                type: 'time',
                format: 'HH:mm',
                range: true,
            });
        });

    });
</script>
{/case}
{case value="textarea"}
<div class="layui-form-item item-{$vo.name} {$vo.extra_class|default=''} layui-form-text">
    <label class="layui-form-label">{$vo.title} {if condition="isset($vo.is_require) AND $vo.is_require"}&nbsp;<font
            color="red">*</font>{/if}</label>
    <div class="layui-input-inline">
        <textarea placeholder="请输入{$vo.title}" class="layui-textarea" name="{$vo.name}" {if $vo.max_length > 0}maxlength="{$vo.max_length}"{/if}>{$vo.value}</textarea>
    </div>
    {if $vo.remark}
    <div class="layui-form-mid layui-word-aux">{$vo.remark|raw}</div>
    {/if}
</div>
{/case}
{case value="image"}
<div class="layui-form-item item-{$vo.name} {$vo.extra_class|default=''} layui-form-text">
    <label class="layui-form-label">{$vo.title} {if condition="isset($vo.is_require) AND $vo.is_require"}&nbsp;<font
            color="red">*</font>{/if}</label>
    <div class="layui-input-inline">
        <div class="js-upload-image">
            <div id="file_list_{$vo.name}" class="uploader-list">
                {notempty name="$vo.value"}
                <div class="file-item thumbnail">
                    <img data-original="{$vo.value|get_file_path|default='__STATIC__/admin/img/none.png'}"
                         src="{$vo.value|get_file_path|default='__STATIC__/admin/img/none.png'}" width="100"
                         style="max-height: 100px;">
                    <i class="iconfont icon-delete_fill remove-picture" data-id="{$vo.value}"></i>
                </div>
                {/notempty}
            </div>
            <input type="hidden" name="{$vo.name}" data-multiple="false" data-watermark='' data-thumb=''
                   data-size="{:config('upload_image_size')}" data-ext="{:config('upload_image_ext')}" id="{$vo.name}"
                   value="{$vo.value|default=''}">
            <div class="layui-clear"></div>
            <div id="picker_{$vo.name}"><i class="layui-icon layui-icon-upload"></i> 上传图片</div>

        </div>
    </div>
    {if $vo.remark}
    <div class="layui-form-mid layui-word-aux">{$vo.remark|raw}</div>
    {/if}

</div>
{/case}
{case value="images"}
<div class="layui-form-item item-{$vo.name} {$vo.extra_class|default=''} layui-form-text">
    <label class="layui-form-label">{$vo.title} {if condition="isset($vo.is_require) AND $vo.is_require"}&nbsp;<font
            color="red">*</font>{/if}</label>
    <div class="layui-input-inline">
        <div class="js-upload-images">
            <div id="file_list_{$vo.name}" class="uploader-list">
                {notempty name="$vo.value"}
                {volist name="$vo.value|explode=',',###" id="v"}
                <div class="file-item thumbnail">
                    <img data-original="{$v|get_file_path}"
                         src="{$v|get_file_path|default='__STATIC__/admin/img/none.png'}" width="100"
                         style="max-height: 100px;">
                    <i class="iconfont icon-delete_fill remove-picture" data-id="{$v}"></i>
                    <i class="iconfont icon-yidong move-picture"></i>
                </div>
                {/volist}
                {/notempty}
            </div>
            <input type="hidden" name="{$vo.name}" data-multiple="true" data-watermark='' data-thumb=''
                   data-size="{:config('upload_image_size')}" data-ext="{:config('upload_image_ext')}" id="{$vo.name}"
                   value="{$vo.value|default=''}">
            <div class="layui-clear"></div>
            <div id="picker_{$vo.name}"><i class="layui-icon layui-icon-upload"></i> 上传图片</div>
        </div>
    </div>
    {if $vo.remark}
    <div class="layui-form-mid layui-word-aux">{$vo.remark|raw}</div>
    {/if}
</div>
{/case}
{case value="crop"}
<div class="layui-form-item item-{$vo.name} {$vo.extra_class|default=''} layui-form-text">
    <label class="layui-form-label">{$vo.title} {if condition="isset($vo.is_require) AND $vo.is_require"}&nbsp;<font
            color="red">*</font>{/if}</label>
    <div class="layui-input-inline">
        <div class="js-upload-image">
            <div id="file_list_{$vo.name}" class="uploader-list">
                {notempty name="$vo.value"}
                <div class="file-item thumbnail">
                    <img data-original="{$vo.value|get_file_path|default='__STATIC__/admin/img/none.png'}"
                         src="{$vo.value|get_file_path|default='__STATIC__/admin/img/none.png'}" width="100"
                         style="max-height: 100px;">
                    <i class="iconfont icon-delete_fill remove-picture" data-id="{$vo.value}"></i>
                </div>
                {/notempty}
            </div>
            <input type="hidden" name="{$vo.name}" data-multiple="false" data-watermark='' data-thumb=''
                   data-size="{:config('upload_image_size')}" data-ext="{:config('upload_image_ext')}" id="{$vo.name}"
                   value="{$vo.value|default=''}">
            <div class="layui-clear"></div>
            <button type="button" class="layui-btn" id="upload_{$vo.name}">
                <i class="layui-icon">&#xe67c;</i>上传图片
            </button>

        </div>
    </div>

    <script type="text/javascript">
        var $input_file = $('.js-upload-image').find('input');
        var $input_file_name = $input_file.attr('id');
        // 图片列表
        var $file_list = $('#file_list_' + $input_file_name);

        layui.config({
            base: '__STATIC__/cropper/',
            version: 'v3'
        });
        layui.use(['upload', 'croppers'], function () {
            var crop = layui.croppers;
            //创建一个头像上传组件
            crop.render({
                elem: '#upload_' + $input_file_name
                , mark: '{$vo.remark}'
                , area: '900px'
                , url: '{:url("attachment/upload/upload", ["dir" => "images", "module" => request()->module()])}'
                , done: function (res) {
                    if (res.code == 0) {
                        var html = '<div class="file-item thumbnail"><img src="' + res.path + '" width="100" style="max-height: 100px;"><i class="iconfont icon-delete_fill remove-picture" data-id="' + res.id + '"></i></div>';
                        $file_list.html(html);

                        $input_file.val(res.id);
                    }
                }
            });

        });
    </script>
</div>
{/case}
{case value="crops"}
<div class="layui-form-item item-{$vo.name} {$vo.extra_class|default=''} layui-form-text">
    <label class="layui-form-label">{$vo.title} {if condition="isset($vo.is_require) AND $vo.is_require"}&nbsp;<font
            color="red">*</font>{/if}</label>
    <div class="layui-input-inline">
        <div class="js-upload-images">
            <div id="file_list_{$vo.name}" class="uploader-list">
                {notempty name="$vo.value"}
                {volist name="$vo.value|explode=',',###" id="v"}
                <div class="file-item thumbnail">
                    <img data-original="{$v|get_file_path|default='__STATIC__/admin/img/none.png'}"
                         src="{$v|get_file_path|default='__STATIC__/admin/img/none.png'}" width="100"
                         style="max-height: 100px;">
                    <i class="iconfont icon-delete_fill remove-picture" data-id="{$vo.value}"></i>
                </div>
                {/volist}
                {/notempty}
            </div>
            <input type="hidden" name="{$vo.name}" data-multiple="true" data-watermark='' data-thumb=''
                   data-size="{:config('upload_image_size')}" data-ext="{:config('upload_image_ext')}" id="{$vo.name}"
                   value="{$vo.value|default=''}">
            <div class="layui-clear"></div>
            <button type="button" class="layui-btn" id="upload_{$vo.name}">
                <i class="layui-icon">&#xe67c;</i>上传图片
            </button>

        </div>
    </div>

    <script type="text/javascript">
        // layui.config({
        //     base: '__STATIC__/cropper/',
        //     version: 'v3'
        // });
        var $input_file = $('.js-upload-images').find('input');
        var $input_file_name = $input_file.attr('id');
        // 图片列表
        var $file_list = $('#file_list_' + $input_file_name);

        layui.use(['upload', 'croppers'], function () {
            var croppers = layui.croppers;
            //创建一个头像上传组件
            croppers.render({
                elem: '#upload_' + $input_file_name
                , mark: {$vo.remark}
                , area: '900px'
                , url: '{:url("attachment/upload/upload", ["dir" => "images", "module" => request()->module()])}'
                , done: function (res) {
                    if (res.code == 0) {
                        var html = '<div class="file-item thumbnail"><img src="' + res.path + '" width="100" style="max-height: 100px;"><i class="iconfont icon-delete_fill remove-picture" data-id="' + res.id + '"></i></div>';
                        $file_list.append(html);

                        if ($input_file.val()) {
                            $input_file.val($input_file.val() + ',' + res.id);
                        } else {
                            $input_file.val(res.id);
                        }
                    }
                }
            });

        });
    </script>
</div>
{/case}
{case value="file"}
<div class="layui-form-item item-{$vo.name} {$vo.extra_class|default=''} layui-form-text">
    <label class="layui-form-label">{$vo.title} {if condition="isset($vo.is_require) AND $vo.is_require"}&nbsp;<font
            color="red">*</font>{/if}</label>
    <div class="layui-input-inline">
        <div class="js-upload-file">
            <div id="file_list_{$vo.name}" class="uploader-list">
                <table class="layui-table">
                    <colgroup>
                        <col width="150">
                        <col width="150">
                        <col width="150">
                        <col>
                    </colgroup>
                    <thead>
                    <tr>
                        <th>文件名称</th>
                        <th>提示</th>
                        <th>进度</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody class="file-box">
                    {notempty name="$vo.value"}
                    <tr class="file-item">
                        <td>{$vo.value|get_file_name}</td>
                        <td>/</td>
                        <td>/</td>
                        <td><a href="{$vo.value|get_file_path}" class="layui-btn download-file layui-btn layui-btn-xs">下载</a>
                            <a href="javascript:void(0);"
                               class="layui-btn remove-file layui-btn layui-btn-xs layui-btn-danger">删除</a></td>
                    </tr>
                    {/notempty}
                    </tbody>
                </table>
            </div>
            <input type="hidden" name="{$vo.name}" data-multiple="false" data-size="{:config('upload_file_size')}"
                   data-ext="{notempty name="$file_type"} {$file_type} {else}{:config('upload_file_ext')}{/notempty}" id="{$vo.name}" value="{$vo.value|default=''}">
            <div id="picker_{$vo.name}"><i class="layui-icon layui-icon-upload"></i> 上传单个文件</div>
        </div>
    </div>
</div>
{/case}
{case value="files"}
<div class="layui-form-item item-{$vo.name} {$vo.extra_class|default=''} layui-form-text">
    <label class="layui-form-label">{$vo.title} {if condition="isset($vo.is_require) AND $vo.is_require"}&nbsp;<font
            color="red">*</font>{/if}</label>
    <div class="layui-input-inline">
        <div class="js-upload-file">
            <div id="file_list_{$vo.name}" class="uploader-list">
                <table class="layui-table">
                    <colgroup>
                        <col width="150">
                        <col width="150">
                        <col width="150">
                        <col>
                    </colgroup>
                    <thead>
                    <tr>
                        <th>文件名称</th>
                        <th>提示</th>
                        <th>进度</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody class="file-box">
                    {notempty name="$vo.value"}
                    {volist name="$vo.value|explode=',',###" id="v"}
                    <tr class="file-item">
                        <td>{$v|get_file_name}</td>
                        <td>/</td>
                        <td>/</td>
                        <td><a href="{$v|get_file_path}" class="layui-btn download-file layui-btn layui-btn-xs">下载</a>
                            <a href="javascript:void(0);"
                               class="layui-btn remove-file layui-btn layui-btn-xs layui-btn-danger"
                               data-id="{$v}">删除</a></td>
                    </tr>
                    {/volist}
                    {/notempty}
                    </tbody>
                </table>
            </div>
            <input type="hidden" name="{$vo.name}" data-multiple="true" data-size="{:config('upload_file_size')}"
                   data-ext="{notempty name="$file_type"} {$file_type} {else}{:config('upload_file_ext')}{/notempty}" id="{$vo.name}" value="{$vo.value|default=''}">
            <div id="picker_{$vo.name}"><i class="layui-icon layui-icon-upload"></i> 上传多个文件</div>
        </div>
    </div>
</div>
{/case}
{case value="Ueditor"}
<div class="layui-form-item item-{$vo.name} {$vo.extra_class|default=''} layui-form-text" style="width: 1200px;">
    <label class="layui-form-label">{$vo.title} {if condition="isset($vo.is_require) AND $vo.is_require"}&nbsp;<font
            color="red">*</font>{/if}</label>
    <div class="layui-input-inline" style="width: 900px;">
        <script type="text/plain" class="js-ueditor" id="{$vo.name}" name="{$vo.name}">{$vo.value|raw}</script>
    </div>
    {if $vo.remark}
    <div class="layui-form-mid layui-word-aux">{$vo.remark|raw}</div>
    {/if}
    <div style="margin-top: 5px;">
        <a class="layui-btn layui-btn-sm" id="{$vo.name}grabimg">图片本地化</a>
    </div>
</div>
<script type="text/javascript" src="__STATIC__/libs/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="__STATIC__/libs/ueditor/ueditor.all.js"></script>
{/case}
{case value="summernote"}
<div class="layui-form-item item-{$vo.name} {$vo.extra_class|default=''} layui-form-text"
     style="width: 1200px; height: 580px;">
    <label class="layui-form-label">{$vo.title}</label>
    <div class="layui-input-inline" style="width: 900px; height: 550px">
        <textarea name="{$vo.name}" id="summernote" class="form-control">{$vo.value|default=''}</textarea>
    </div>

    <link href="__STATIC__/libs/bootstrap/bootstrap.css" rel="stylesheet">
    <script src="__STATIC__/libs/bootstrap/bootstrap.js"></script>
    <link rel="stylesheet" type="text/css" href="__STATIC__/libs/summernote/summernote.css">
    <style type="text/css" media="screen">
        .note-editor {
            height: 550px;
            text-align: left;
        }

        .note-editor .modal-body .form-group {
            margin: 0;
        }
    </style>
    <script type="text/javascript" src="__STATIC__/libs/summernote/summernote.min.js" charset="utf-8"></script>
    <script type="text/javascript">
        $(function () {
            var $summernote = $('#summernote').summernote({
                height: 500,
                toolbar: [
                    ['style', ['style', 'bold', 'italic', 'underline', 'clear']],
                    ['font', ['strikethrough', 'fontsize', 'fontname', 'color', 'forecolor', 'backcolor']],
                    ['para', ['ul', 'ol', 'paragraph', 'height', 'table']],
                    ['insert', ['link', 'picture', 'video']],
                    ['misc', ['undo', 'redo', 'fullscreen', 'codeview']]
                ],
                // 可选：自定义字体大小选项
                fontSizes: ['8', '10', '12', '14', '16', '18', '24', '36'],
                //调用图片上传
                callbacks: {
                    onImageUpload: function (files) {
                        sendFile($summernote, files[0]);
                    }
                }
            });

            //ajax上传图片
            function sendFile($summernote, file) {
                var formData = new FormData();
                formData.append("file", file);
                $.ajax({
                    url: '{:url("attachment/Upload/upload", array("dir" => "images", "from" => "summernote", "module" => "admin"))}',//上传文件路径
                    data: formData,
                    dataType: 'json',
                    cache: false,
                    contentType: false,
                    processData: false,
                    type: 'post',
                    success: function (data) {
                        var imageUrl = data.url
                        $summernote.summernote('insertImage', imageUrl, function ($image) {
                            $image.attr('src', imageUrl);
                        });
                    }
                });
            }
        });
    </script>

</div>
{/case}
{case value="area"}
<div class="layui-form-item item-{$vo.name} {$vo.extra_class|default=''}">
    <label class="layui-form-label">{$vo.title} {if condition="isset($vo.is_require) AND $vo.is_require"}&nbsp;<font
            color="red">*</font>{/if}</label>
    {volist name="vo.remark" id="v"}
    <div class="layui-input-inline" style="width: 200px;">
        <select lay-search name="{$v}" data-area="<?php echo $vo['options'][$key]; ?>"
                class="province-selector data_{$v}" lay-filter="{$v}">
            <option value="">请选择</option>
        </select>
    </div>
    {/volist}

</div>
{/case}
{case value="area_text"}
<div class="layui-form-item item-{$vo.name} {$vo.extra_class|default=''}" id="area-picker">
    <label class="layui-form-label">{$vo.title} {if condition="isset($vo.is_require) AND $vo.is_require"}&nbsp;<font
            color="red">*</font>{/if}</label>
    <div class="layui-input-inline" style="width: 200px;">
        <select lay-search name="province" class="province-selector" data-value="广东省" lay-filter="province-1">
            <option value="">请选择省</option>
        </select>
    </div>
    <div class="layui-input-inline" style="width: 200px;">
        <select lay-search name="city" class="city-selector" data-value="深圳市" lay-filter="city-1">
            <option value="">请选择市</option>
        </select>
    </div>
    <div class="layui-input-inline" style="width: 200px;">
        <select lay-search name="county" class="county-selector" data-value="龙岗区" lay-filter="county-1">
            <option value="">请选择区</option>
        </select>
    </div>

</div>
{/case}
{case value="video"}
<div class="layui-form-item item-{$vo.name} {$vo.extra_class|default=''}">
    <label class="layui-form-label">{$vo.title}</label>
    <div class="layui-container">
        <div class="layui-row">
            <div class="layui-col-md12">
                <section class="layui-card">
                    <div class="layui-card-body">
                        <div class="video" id="video" style="width: 833px;height: 500px"></div>
                    </div>
                </section>
            </div>
        </div>
    </div>
    <script>
        layui.config({
            //存放拓展模块的根目录
            base: '__STATIC__/libs/',
        }).extend({
            ckplayer: 'ckplayer/ckplayer'
        }).use(['ckplayer'], function () {
            var ckplayer = layui.ckplayer;
            //定义视频资源地址
            var videoUrl = '{$vo.value}';
            //由于X2的ckplayer需要用url请求方式获取配置json
            //因此定义请求的根目录
            var baseUrl = "__STATIC__/libs/ckplayer/"

            //定义一个变量：videoObject，用来做为视频初始化配置
            var videoObject = {
                container: '#video',
                variable: 'player',
                video: videoUrl, //视频地址
                baseUrl: baseUrl //配置json所在目录
            };
            var player = new ckplayer(videoObject);//初始化播放器
        });

    </script>

</div>
{/case}
{case value="tags"}
<div class="layui-form-item item-{$vo.name} {$vo.extra_class|default=''}">
    <link rel="stylesheet" type="text/css" href="__STATIC__/libs/tags/css/css.css">
    <script src="__STATIC__/libs/tags/js/tagsinput.js" type="text/javascript" charset="utf-8"></script>

    <label class="layui-form-label">{$vo.title} {if condition="isset($vo.is_require) AND $vo.is_require"}&nbsp;<font
            color="red">*</font>{/if}</label>
    <div class="fairy-tag-container layui-input-inline tagsinput-primary">
        <input type="text" id="tagsinputval" data-role="tagsinput" class="tagsinputval layui-input" name="{$vo.name}"
               value="{$vo.value}">
    </div>
    {if $vo.remark}
    <div class="layui-form-mid layui-word-aux">{$vo.remark|raw}</div>
    {/if}

</div>
{/case}
{case value="oss_aliyun"}
<div class="layui-form-item item-{$vo.name} {$vo.extra_class|default=''}">
    <link rel="stylesheet" type="text/css" href="__STATIC__/libs/oss/style.css"/>

    <label class="layui-form-label">{$vo.title} {if condition="isset($vo.is_require) AND $vo.is_require"}&nbsp;<font
            color="red">*</font>{/if}</label>
    <div class="layui-input-inline">
        <div id="oss_upload_{$vo.name}"></div>
        <div id="oss_aliyun">
            <input type="hidden" name="{$vo.name}" value="{$vo.value}">
            <h5>您所选择的文件：</h5>
            <div id="ossfile">你的浏览器不支持flash,Silverlight或者HTML5！</div>

            <ul class="list-group file-box">
                {notempty name="$vo.value"}
                <li class="list-group-item file-item" data-id="{$vo.value}">
                    <i class="layui-icon layui-icon-file"></i>
                    <span>{$vo.value}</span>
                    <i class="layui-icon layui-icon-close remove-file"></i>
                    <button class="layui-btn layui-btn-normal video-play" style="margin-left: 50px">播放</button>
                </li>
                {/notempty}
            </ul>
            <div id="container">
                <a id="selectfiles" href="javascript:void(0);" class='btn'>选择文件</a>
                <a id="postfiles" href="javascript:void(0);" class='btn'>开始上传</a>
            </div>
        </div>
        {if $vo.remark}
        <div class="layui-form-mid layui-word-aux">{$vo.remark|raw}</div>
        {/if}
    </div>

    <span id="console"></span>
    <script type="text/javascript" src="__STATIC__/libs/oss/lib/crypto1/crypto/crypto.js"></script>
    <script type="text/javascript" src="__STATIC__/libs/oss/lib/crypto1/hmac/hmac.js"></script>
    <script type="text/javascript" src="__STATIC__/libs/oss/lib/crypto1/sha1/sha1.js"></script>
    <script type="text/javascript" src="__STATIC__/libs/oss/lib/base64.js"></script>
    <script type="text/javascript" src="__STATIC__/libs/oss/lib/plupload-2.1.2/js/plupload.full.min.js"></script>
    <script type="text/javascript" src="__STATIC__/libs/oss/upload.js"></script>

    <script>
        //删除文件
        $('#oss_aliyun .remove-file').click(function () {
            var form = $('.form-horizontal').serialize();
            var ready_for_remove_id = $(this).closest('.file-item').attr('data-id'); //获取待删除的文件ID

            if (!ready_for_remove_id) {
                $.alertMessager('错误', 'danger');
            }

            $.post('{:url("Attachment/upload/oss_delete")}', $('.form-horizontal').serialize()).success(function (res) {
                if (res.code === 0) {
                    $('#oss_aliyun input').val('') //删除后覆盖原input的值为空
                    $(this).closest('.file-item').remove(); //删除文件预览
                    $('#oss_aliyun ul .file-item').remove()
                } else {
                    layer.msg(res.msg, {time: 1000, icon: 2});
                }
                layer.close(index);
            });
            return false;
        });

        $('.video-play').click(function () {
            var url = $(this).closest('.file-item').attr('data-id'); //获取待删除的文件ID
            $.ajax({
                type: "POST",
                url: "{:url('admin/common/play')}",
                data: {
                    url: url,
                },
                success: function (data) {
                    layer.open({
                        type: 1,
                        title: '视频播放',
                        shadeClose: true,
                        shade: 0.8,
                        area: ['85vw', '90vh'],
                        content: data,
                        closeBtn: 1,
                    });
                }
            });
            return false;
        });
    </script>
</div>
{/case}

{/switch}

{/volist}

<style>
    .layui-btn + .layui-btn {
        margin-left: 0;
    }
</style>

<script type="text/javascript" src="__STATIC__/libs/webuploader/webuploader.min.js"></script>
<link rel="stylesheet" href="__STATIC__/libs/webuploader/webuploader.css">

<script type="text/javascript" src="__STATIC__/admin/js/form.js"></script>

<script type="text/javascript" src="__STATIC__/libs/Sortable.js"></script>
<script type="text/javascript" src="__STATIC__/libs/viewer/viewer.min.js"></script>
<link rel="stylesheet" href="__STATIC__/libs/viewer/viewer.min.css">

<script type="text/javascript">
    $('.uploader-list').each(function () {
        $(this).viewer();
    });
</script>
